#include "stdafx.h"
#include "MyProccess.h"



MyProccess::MyProccess(void)
{
	arrivedTime=0;
	runTime=0;
	priority=0;
	leftTime=0;
	rrRunTime=0;
	turnoverTime=0;
	responseTime=0;

	 responseFlag=false;
	 turnoverFlag=false;

}


MyProccess::~MyProccess(void)
{
}

MyProccess &MyProccess::operator=(const MyProccess mp){
	arrivedTime=mp.arrivedTime;
	runTime=mp.runTime;
	priority=mp.priority;

	leftTime=mp.leftTime;
	rrRunTime=mp.rrRunTime;
	turnoverTime=mp.turnoverTime;
	responseTime=mp.responseTime;
	responseFlag=mp.responseFlag;
	turnoverFlag=mp.turnoverFlag;

	return *this;
}

void MyProccess::setResponseTime(int time){

	if(!responseFlag){
		responseTime=time-arrivedTime;
		responseFlag=true;
	}
}
void MyProccess::setTurnOverTime(int finishtime){

	if(!turnoverFlag){
		turnoverTime=finishtime-arrivedTime;
		turnoverFlag=true;
	}
}

	int MyProccess::getResponseTime(){
		return responseTime;
	}
	int MyProccess::getTurnOverTime(){
		return turnoverTime;
	}